﻿@page "/"
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@attribute [Authorize]

<h3>Name:@AuthState?.User?.Identity?.Name</h3>
<hr />
<h3>IsAuthenticated:@AuthState?.User?.Identity?.IsAuthenticated</h3>

@code {
    [CascadingParameter]
    private Task<AuthenticationState>? authenticationState { get; set; }

    AuthenticationState? AuthState;

    protected override async Task OnInitializedAsync()
    {
        AuthState = await authenticationState;
    }
}